package com.wc.alorithm_blue_bridge._思维.Q3262;

import java.util.*;

/**
 * @Author congege
 * @Description 笨笨的机器人
 * https://www.lanqiao.cn/problems/3262/learning/?page=1
 * @Date Created in 2023/11/27-15:14
 */
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        /**
         * 存之前的数
         */
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(0);
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
            ArrayList<Integer> tmp = new ArrayList<>();
            for (int num : arrayList) {
                /**
                 * 向左为 +
                 * 向右为 -
                 */
                tmp.add(Math.abs(num + array[i]));
                tmp.add(Math.abs(num - array[i]));
            }
            arrayList = tmp;
        }
        int cnt = 0;
        for (int num : arrayList) {
            if (num % 7 == 0) {
                cnt++;
            }
        }
        System.out.printf("%.4f\n", round(cnt * 1.0 / arrayList.size(), 4));
        scan.close();
    }

    static double round(double res, int dit) {
        double range = Math.pow(10, dit);
        return Math.round(res * range) / range;
    }
}
